home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap13 / Wanderer / WandDoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  850 b   |  29 lines

  1. //***********************************************************************
  2. //
  3. //  WandDoc.cpp
  4. //
  5. //***********************************************************************
  6.  
  7. #include <afxwin.h>
  8. #include "WandDoc.h"
  9.  
  10. IMPLEMENT_DYNCREATE (CWandDoc, CDocument)
  11.  
  12. BOOL CWandDoc::RouteCmdToAllViews (CView* pView, UINT nID, int nCode,
  13.     void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
  14. {
  15.     POSITION pos = GetFirstViewPosition ();
  16.  
  17.     while (pos != NULL) {
  18.         CView* pNextView = GetNextView (pos);
  19.         if (pNextView != pView) {
  20.             // Cast CView upward to CCmdTarget because OnCmdMsg is
  21.             // erroneously declared protected in CView
  22.             if (((CCmdTarget*) pNextView)->OnCmdMsg (nID, nCode,
  23.                 pExtra, pHandlerInfo))
  24.                 return TRUE;
  25.         }
  26.     }
  27.     return FALSE;
  28. }
  29.